(global.webpackJsonp = global.webpackJsonp || []).push([ [ "xg_o2o/distribution/distribution" ], {
    4967: function(e, t, n) {},
    5258: function(e, t, n) {
        "use strict";
        n.r(t);
        var i = n("c1ef"), a = n("979e");
        for (var o in a) "default" !== o && function(e) {
            n.d(t, e, function() {
                return a[e];
            });
        }(o);
        n("a4dd");
        var s = n("f0c5"), c = Object(s.a)(a.default, i.b, i.c, !1, null, null, null, !1, i.a, void 0);
        t.default = c.exports;
    },
    "979e": function(e, t, n) {
        "use strict";
        n.r(t);
        var i = n("cd1f"), a = n.n(i);
        for (var o in i) "default" !== o && function(e) {
            n.d(t, e, function() {
                return i[e];
            });
        }(o);
        t.default = a.a;
    },
    a4dd: function(e, t, n) {
        "use strict";
        var i = n("4967");
        n.n(i).a;
    },
    c1ef: function(e, t, n) {
        "use strict";
        n.d(t, "b", function() {
            return a;
        }), n.d(t, "c", function() {
            return o;
        }), n.d(t, "a", function() {
            return i;
        });
        var i = {
            gracePage: function() {
                return n.e("graceUI/components/gracePage").then(n.bind(null, "1915"));
            },
            graceFullLoading: function() {
                return n.e("graceUI/components/graceFullLoading").then(n.bind(null, "7669"));
            },
            graceDialog: function() {
                return n.e("graceUI/components/graceDialog").then(n.bind(null, "8d15"));
            },
            divider: function() {
                return n.e("components/divider/divider").then(n.bind(null, "bdb7"));
            },
            graceCheckBtn: function() {
                return n.e("graceUI/components/graceCheckBtn").then(n.bind(null, "d274"));
            }
        }, a = function() {
            this.$createElement, this._self._c;
        }, o = [];
    },
    cd1f: function(e, t, n) {
        "use strict";
        (function(e) {
            Object.defineProperty(t, "__esModule", {
                value: !0
            }), t.default = void 0;
            var n = {
                data: function() {
                    return {
                        idCard1: "./static/ps2cd8e5feb924c1f4-b826-4dcd-a986-c338a92b57db.png",
                        idCard2: "./static/ps8f524a9bcb0ab440-6a40-408d-86a1-64d365a2168a.png",
                        title: "推广员申请",
                        tel: "0",
                        realname: "",
                        telphone: "",
                        avatarUrl: "",
                        bottomColor: "",
                        vipcardId: 0,
                        graceFullLoading: !0,
                        isshare: 1,
                        bgimg: "",
                        shareimg: "",
                        topcolor: "",
                        ischeck: !0,
                        content: "",
                        show1: !1,
                        sharetitle: "加入推广，一块来赚钱吧！",
                        uploadServerUrl: "",
                        card1: "",
                        card2: "",
                        tmplIds: [],
                        msg: "",
                        iscard: 0,
                        isalipay: 0,
                        showLogin: !1,
                        showBack: !1
                    };
                },
                onLoad: function() {
                    var e = getCurrentPages();
                    this.showBack = e.length > 1, this.uploadServerUrl = this.$xRequest.url("entry/wxapp/v4uploadimg");
                },
                onShow: function() {
                    this.centerInfo();
                },
                methods: {
                    decryptPhoneNumber: function(t) {
                        var n = this;
                        if (t.detail.encryptedData && t.detail.iv) {
                            var i = this.$xSign.sign("v4getopenid");
                            this.$xRequest.request({
                                url: "entry/wxapp/v4getopenid",
                                data: {
                                    encryptedData: t.detail.encryptedData,
                                    iv: t.detail.iv,
                                    xgsign: i,
                                    op: "getphone"
                                },
                                success: function(e) {
                                    n.telphone = e.data.data.purePhoneNumber;
                                },
                                fail: function(t) {
                                    e.showToast({
                                        title: "获取失败，请重试或者手动填写",
                                        icon: "none",
                                        mask: !0
                                    }), n.$xRequest.login();
                                }
                            });
                        } else e.showToast({
                            title: "获取失败，请重试或者手动填写!",
                            icon: "none",
                            mask: !0
                        }), this.$xRequest.login();
                    },
                    closeDialogLogin: function() {
                        this.showLogin = !1;
                    },
                    confirmLogin: function() {
                        var e = this;
                        this.closeDialogLogin();
                        var t = this.$xSign.sign("v4getopenid");
                        wx.getUserProfile({
                            desc: "为您提供更好的服务",
                            success: function(n) {
                                e.$xRequest.request({
                                    url: "entry/wxapp/v4getopenid",
                                    data: {
                                        userinfo: n.userInfo,
                                        xgsign: t,
                                        op: "userprofile"
                                    },
                                    success: function(e) {}
                                });
                            }
                        });
                    },
                    editInfo: function(t) {
                        var n = this;
                        if (1 != this.iscard || t.card1 && t.card2) {
                            this.graceFullLoading = !0;
                            var i = this.$xSign.sign("v4distribution");
                            this.$xRequest.request({
                                url: "entry/wxapp/v4distribution",
                                data: {
                                    xgsign: i,
                                    op: "edit",
                                    formdata: t
                                },
                                success: function(t) {
                                    0 == t.data.errno ? e.showModal({
                                        title: "提示",
                                        content: t.data.message,
                                        showCancel: !1,
                                        complete: function(t) {
                                            t.confirm && (n.tmplIds.length > 0 ? wx.requestSubscribeMessage({
                                                tmplIds: n.tmplIds,
                                                complete: function(t) {
                                                    setTimeout(function() {
                                                        e.reLaunch({
                                                            url: "../index/index"
                                                        });
                                                    }, 800);
                                                }
                                            }) : setTimeout(function() {
                                                e.reLaunch({
                                                    url: "../index/index"
                                                });
                                            }, 800));
                                        }
                                    }) : (e.hideLoading(), e.showModal({
                                        title: "提示",
                                        content: t.data.message,
                                        showCancel: !1,
                                        complete: function(t) {
                                            n.graceFullLoading = !1, t.confirm && setTimeout(function() {
                                                e.reLaunch({
                                                    url: "../index/index"
                                                });
                                            }, 800);
                                        }
                                    }));
                                },
                                fail: function(t) {
                                    e.hideLoading(), e.showModal({
                                        title: "提示",
                                        content: t.data.message,
                                        showCancel: !1,
                                        complete: function(t) {
                                            n.graceFullLoading = !1, t.confirm && setTimeout(function() {
                                                e.reLaunch({
                                                    url: "../index/index"
                                                });
                                            }, 800);
                                        }
                                    });
                                }
                            });
                        } else e.showToast({
                            title: "身份证照片上传错误，请重试",
                            icon: "none"
                        });
                    },
                    checkedChange: function(e) {
                        this.ischeck = e[0];
                    },
                    showDialog1: function() {
                        this.show1 = !0;
                    },
                    closeDialog1: function() {
                        this.show1 = !1;
                    },
                    centerInfo: function() {
                        var t = this, n = this.$xSign.sign("v4distribution");
                        this.$xRequest.request({
                            url: "entry/wxapp/v4distribution",
                            data: {
                                xgsign: n,
                                op: "getinfo"
                            },
                            success: function(n) {
                                var i = JSON.parse(t.$Decrypt(n.data.data));
                                0 == n.data.errno ? (t.isshare = i.share, 2 == i.share ? (t.tel = i.tel, t.bottomColor = i.color, 
                                t.realname = i.realname, t.vipcardId = i.vipid, t.isshare = i.share, t.bgimg = i.bgimg, 
                                t.shareimg = i.shareimg, t.topcolor = i.topcolor, t.content = i.content, t.sharetitle = i.sharetitle, 
                                t.tmplIds = i.tmplIds, t.isalipay = i.isalipay, t.alipay = i.alipay, t.msg = i.msg, 
                                t.iscard = i.iscard, setTimeout(function() {
                                    t.graceFullLoading = !1;
                                }, 400), i.nickname || (t.showLogin = !0), i.msg && e.showToast({
                                    title: i.msg,
                                    icon: "none"
                                })) : (e.showToast({
                                    title: "推广功能暂时关闭！",
                                    icon: "none"
                                }), setTimeout(function() {
                                    e.reLaunch({
                                        url: "../index/index"
                                    });
                                }, 1200))) : (e.showToast({
                                    title: n.data.message,
                                    icon: "none"
                                }), setTimeout(function() {
                                    "您的申请已通过,无需重复提交!" == n.data.message ? e.redirectTo({
                                        url: "distributor"
                                    }) : e.reLaunch({
                                        url: "../index/index"
                                    });
                                }, 1200));
                            },
                            fail: function(t) {
                                e.showToast({
                                    title: t.data.message,
                                    icon: "none"
                                }), setTimeout(function() {
                                    "您的申请已通过,无需重复提交!" == t.data.message ? e.redirectTo({
                                        url: "distributor"
                                    }) : e.reLaunch({
                                        url: "../index/index"
                                    });
                                }, 1200);
                            }
                        });
                    },
                    selectImg1: function() {
                        var t = this;
                        e.chooseImage({
                            count: 1,
                            sizeType: [ "compressed" ],
                            success: function(e) {
                                t.idCard1 = e.tempFilePaths[0];
                            }
                        });
                    },
                    selectImg2: function() {
                        var t = this;
                        e.chooseImage({
                            count: 1,
                            sizeType: [ "compressed" ],
                            success: function(e) {
                                t.idCard2 = e.tempFilePaths[0];
                            }
                        });
                    },
                    uploadCards: function(t) {
                        var n = this, i = t.detail.value;
                        i.realname && /^[\u0391-\uFFE5]+$/.test(i.realname) ? 1 != this.iscard || /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(i.cardid) ? /(^1[3|4|5|6|7|8|9][0-9]{9}$)/.test(i.mobile) ? 1 != this.isalipay || i.alipay ? (1 != this.isalipay && (i.alipay = this.alipay), 
                        1 != this.iscard || "./static/card/ps2cd8e5feb924c1f4-b826-4dcd-a986-c338a92b57db.png" != this.idCard1 && "./static/card/ps8f524a9bcb0ab440-6a40-408d-86a1-64d365a2168a.png" != this.idCard2 ? 0 != this.ischeck ? 1 == this.iscard ? (e.showLoading({
                            title: "上传身份证正面"
                        }), e.uploadFile({
                            url: this.uploadServerUrl,
                            filePath: this.idCard1,
                            name: "img",
                            success: function(t) {
                                "ok" != (t = JSON.parse(t.data)).status ? e.showToast({
                                    title: "上传失败 : " + t.data,
                                    icon: "none"
                                }) : (e.hideLoading(), n.card1 = t.data, i.card1 = t.data, e.showLoading({
                                    title: "上传身份证反面"
                                }), e.uploadFile({
                                    url: n.uploadServerUrl,
                                    filePath: n.idCard2,
                                    name: "img",
                                    success: function(t) {
                                        e.hideLoading(), "ok" != (t = JSON.parse(t.data)).status ? e.showToast({
                                            title: "上传失败 : " + t.data,
                                            icon: "none"
                                        }) : (n.card2 = t.data, i.card2 = t.data, n.editInfo(i));
                                    },
                                    fail: function(t) {
                                        e.showToast({
                                            title: "上传失败，请重试",
                                            icon: "none"
                                        }), e.hideLoading();
                                    },
                                    complete: function() {
                                        e.hideLoading();
                                    }
                                }));
                            },
                            fail: function(t) {
                                e.showToast({
                                    title: "上传失败，请重试",
                                    icon: "none"
                                }), e.hideLoading();
                            },
                            complete: function() {
                                e.hideLoading();
                            }
                        })) : this.editInfo(i) : e.showToast({
                            title: "请阅读并同意推广协议",
                            icon: "none"
                        }) : e.showToast({
                            title: "请选择身份证照片",
                            icon: "none"
                        })) : e.showToast({
                            title: "请填写支付宝账号",
                            icon: "none"
                        }) : e.showToast({
                            title: "请输入正确的手机号码",
                            icon: "none",
                            duration: 800
                        }) : e.showToast({
                            title: "身份证号码不正确",
                            icon: "none"
                        }) : e.showToast({
                            title: "请输入正确的姓名",
                            icon: "none"
                        });
                    }
                }
            };
            t.default = n;
        }).call(this, n("543d").default);
    },
    f54f: function(e, t, n) {
        "use strict";
        (function(e) {
            function t(e) {
                return e && e.__esModule ? e : {
                    default: e
                };
            }
            n("4e1e"), t(n("66fd")), e(t(n("5258")).default);
        }).call(this, n("543d").createPage);
    }
}, [ [ "f54f", "common/runtime", "common/vendor" ] ] ]);